Hi,
We use the incidents API (https://api.pagerduty.com/incidents) and recently added the incident_key to ensure we were deduplicating incidents at the time of creation. However recently we have been getting the above error and we don’t know why, can anyone shed some light on this?
We wrap the date and time (rounded to an hour) together with the distinct alert text, and hash this into the incident_key. We do this because we have an agent that runs in different locations which could trigger the same event.
An example payload is as follows:
{ "incident": { "type": "incident", "title": "WildFly service has stopped (prd-wholesale@hosted.redacted.com)", "service": { "id": "redacted", "type": "service_reference" }, "body": { "type": "incident_body", "details": "The WildFly service was discovered to be in a stopped state." }, "incident_key": "yhlegcrlmzryz2chczhdr3yyg4t_45nu9gd5cor5m1s=" } }
Which returns:
{"error":{"message":"Arguments Caused Error","code":2002,"errors":["Incident could not be assigned"]}} (HTTP/1.1 400 Bad Request)
Many thanks,
Ross